package www.kingee.socket;

import java.io.IOException;
import java.io.PrintStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;

public class MyServer
{
  public static ArrayList<Socket> socketList = new ArrayList();

  public static void main(String[] args) throws IOException { ServerSocket ss = new ServerSocket(30000);
    while (true) {
      System.out.println("等待客户端请求");
      Socket s = ss.accept();
      socketList.add(s);
      System.out.println("一个客户端已经连接");
      new Thread(new ServerThread(s)).start();
    }
  }
}

